package oj;

import java.util.Scanner;

public class Day36F {
    static long a1;
    static long b1;
    static long a2;
    static long b2;
    static String x1;
    static String x2;
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            String str=sc.nextLine();
            String str1=str.replaceAll("/"," ");
            String[] ch=str1.split(" ");
            a1=Integer.valueOf(ch[0]);
            b1=Integer.valueOf(ch[1]);
            a2=Integer.valueOf(ch[2]);
            b2=Integer.valueOf(ch[3]);
            x1=number(a1,b1);
            x2=number(a2,b2);
            sum(a1,b1,a2,b2);
            dif(a1,b1,a2,b2);
            mul(a1,b1,a2,b2);
            div(a1,b1,a2,b2);

        }
    }
    private static void sum(long a1,long b1,long a2,long b2){
        if("0".equals(x1)){
            sout(x1,"+",x2,x2);
        }else if("0".equals(x2)){
            sout(x1,"+",x2,x1);
        }else{
            long a=a1*b2+a2*b1;
            long b=b1*b2;
            String Sum=number(a,b);
            sout(x1,"+",x2,Sum);
        }
    }
    private static void dif(long a1,long b1,long a2,long b2){
        a2=-a2;
        if("0".equals(x1)){
            sout(x1,"-",x2,number(a2,b2));
        }if("0".equals(x2)){
            sout(x1,"-",x2,x1);
        }else{
            long a=a1*b2+a2*b1;
            long b=b1*b2;
            String Sum=number(a,b);
            sout(x1,"-",x2,Sum);
        }
    }
    private static void mul(long a1,long b1,long a2,long b2){
        if("0".equals(x1) || "0".equals(x2)){
            sout(x1,"*",x2,"0");
        }else if("1".equals(x1)){
            sout(x1,"*",x2,x2);
        }else if("1".equals(x2)){
            sout(x1,"*",x2,x1);
        }else{
            long a=a1*a2;
            long b=b1*b2;
            String Mul=number(a,b);
            sout(x1,"*",x2,Mul);
        }
    }
    private static void div(long a1,long b1,long a2,long b2){
        long tmp=a2;
        a2=b2;
        b2=tmp;
        if("0".equals(x1)){
            sout(x1,"/",x2,"0");
        }else if("0".equals(x2)){
            sout(x1,"/",x2,"Inf");
        }else if("1".equals(x1)){
            sout(x1,"/",x2,number(a2,b2));
        }else if("1".equals(x2)){
            sout(x1,"/",x2,x1);
        }else{
            long a=a1*a2;
            long b=b1*b2;
            String Div=number(a,b);
            sout(x1,"/",x2,Div);
        }
    }
    private static void sout(String x,String sign,String y,String z){
        System.out.println(x + " " + sign + " " + y + " " + "=" + " " + z);
    }
    private static String number(long x,long y){
        if(x==0){
            return "0";
        }else if((x>0&&y>0)||(x<0&&y<0)){
            if(x%y==0){
                return Math.abs(x/y)+" ";
            }else if(x==y){
                return 1+" ";
            }else if(Math.abs(x)>Math.abs(y)){
                return Math.abs(x/y)+" "+simple(x%y,y);
            }else if(Math.abs(x)<Math.abs(y)){
                return simple(x%y,y);
            }
        }else if(x<0&&y>0){
            if(x%y==0){
                return  "("+"-"+Math.abs(x/y)+")";
            }else if(Math.abs(x)==y){
                return -1+" ";
            }else if(Math.abs(x)>y){
                return "("+x/y+" "+simple(x%y,y)+")";
            }else if(Math.abs(x)<y){
                return "("+"-"+simple(x%y,y)+")";
            }
        }else if(x>0&&y<0){
            if(x%y==0){
                return  "("+"-"+Math.abs(x/y)+")";
            }else if(x==Math.abs(y)){
                return -1+" ";
            }else if(x>Math.abs(y)){
                return"("+"-"+Math.abs(x/y)+" "+simple(x%y,y)+")";
            }else if(x<Math.abs(y)){
                return "("+"-"+simple(x%y,y)+")";
            }
        }
        return null;
    }
    private static String simple(long x,long y){
        x=Math.abs(x);
        y=Math.abs(y);
        long z=x<y?x:y;
        while(z>1){
            if(x%z==0 && y%z==0){
                x=x/z;
                y=y/z;
            }
            z--;
        }
        return x + "/" + y;
    }
}